package com.collection;
import java.util.List;
import java.util.ArrayList;
import java.util.Vector;
public class ListExam {
	public static void main(String[] args) {
		List<String> list = new ArrayList<String>();
		List<String> list2 = new Vector<String>();
		list.add("grape");//0
		list.add("banana");//1
		list.add("watermalon");//2
		//insert
		list.add(2,"apple");//grape banana apple
		for(int i=0;i<list.size();i++){
			System.out.println("standard:"+list.get(i));
		}
		//delete
		list.remove(3);
		list.remove("watermalon");
		System.out.println("before kiwi exist:"
				+list.indexOf("kiwi"));//-1
		list.set(1,"kiwi");
		for(String str:list){
			System.out.println("other:"+str);
		}
		System.out.println("kiwi exist:"
		                  +list.indexOf("kiwi"));//1
	}
}